<!DOCTYPE html>
<html>
<head>
<div th:replace="common/common_resource :: common_css"></div>
<title th:text="${application.shop_name} +' | 角色维护'"></title>
</head>
<body class="hold-transition skin-blue sidebar-mini" >
	<div class="wrapper">
		<div th:replace="common/common_h5 :: loginAndLogout"></div>
		<div th:replace="common/common_h5 :: upload_image"></div>
		<div th:replace="common/common_h5 :: left_menu"></div>
		<div class="content-wrapper">
			<section class="content">
				<div class="row">
					<div class="col-xs-12">
						<div class="box">
							<div class="box-header">
								<div class="row">
									<div class="col-xs-4">
										<span>
											<button type="button"  name="cleanAll" id="add_dep"class="btn  btn-warning " style="margin-bottom: 10px;"data-toggle="modal" data-target="#role_add_and_update">
													<i class="fa fa-plus">添加角色</i>
											</button>
										</span>
										<div class="modal fade " id="role_add_and_update" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
											<div class="modal-dialog ">
												<div class="modal-content">
													<div class="modal-header bg-blue">
														<button type="button" name="cleanAll" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
														<h4 class="modal-title" id="myModalLabel">添加/修改角色</h4>
													</div>
													<div class="modal-body">
														<form role="form" id="formrole" th:action="${#httpServletRequest.getContextPath()}+'/role/insertAndUpdate'" method="post">
														<input type="hidden" name="menuUuid" th:value="${menuUuid!=null}?${menuUuid}:'730'">
															<div class="box-body">
 																<div class="form-group">
																	<label for="role_name">角色名称</label>
																	<input type="hidden" name="roleUuid" th:value="${dataBean!=null? dataBean.roleUuid:''}" id="roleUuid" />
																	<input type="text" name="roleName" th:value="${dataBean!=null? dataBean.roleName:''}" class="form-control" id="roleName" placeholder="角色名称" />
																</div>
																<div class="form-group">
																	<label for="role_code">角色编码</label>
																	<input type="text" class="form-control" th:value="${dataBean!=null? dataBean.roleCode:''}" name="roleCode" id="roleCode" placeholder="角色编码" />
																</div>
																<label class="">资源</label>
																<div class="form-group">
																	<label class="checkboxs" th:each="resources,resourcesStat : ${resList}">
																		<div class="icheckbox_minimal-blue " aria-checked="false" aria-disabled="false" style="position: relative;">
																			<input type="checkbox" th:value="${resources.resUuid}" name="resUuids"class="minimal"  style="position: absolute; opacity: 0;" />
																		</div>
																		<span th:text="${resources.resName}"></span>
																	</label>
																</div>
																<label class="">菜单</label>
																<div class="form-group" id="caidan">
																	<label class="checkboxs" th:each="menu,menuStat : ${menuList}">
																		<div class="icheckbox_minimal-blue " aria-checked="false" aria-disabled="false" style="position: relative;">
																			<input type="checkbox" th:value="${menu.menuUuid}" name="menuUuids" class="minimal" style="position: absolute; opacity: 0;" />
																		</div>
																		<span th:text="${menu.menuName}"></span>
																	</label>
																</div>
															</div>
															<div class="modal-footer">
																<div class="row">
																	<div class="col-xs-6 text-center">
																		<button type="reset" class="btn btn-warning" name="cleanAll" >清&nbsp;&nbsp;&nbsp;&nbsp;空</button>
																	</div>
																	<div class="col-xs-6 text-center">
																		<button type="submit" class="btn btn-primary">提&nbsp;&nbsp;&nbsp;&nbsp;交</button>
																	</div>
																</div>
															</div>
														</form>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div class="col-xs-4">
										<h3 class="box-title">角色数据列表</h3>
									</div>
									<div class="col-xs-4"></div>
								</div>
							</div>
							<div class="box-body table-responsive">
								<table id="example2" class="table table-bordered table-striped">
									<thead>
										<tr class="bg-green ">
											<th>角色编号</th>
											<th>角色名称</th>
											<th>角色编码</th>
											<th>是否可用</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>

										<tr th:class="${rolestar.index % 2 ==0}? '' : 'bg-gray'"
											th:each="role,rolestar:${rList}">
											<td th:text="${role.roleUuid}"></td>
											<td th:text="${role.roleName}"></td>
											<td th:text="${role.roleCode}"></td>
											<td><i class="fa fa-circle text-success"></i>可用</td>
											<td>&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="javascript:void(0);" class="fa fa-file btn btn-primary" name="show"th:id="${role.roleUuid}">详情</a>&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="javascript:void(0);" th:id="${role.roleUuid}" data-toggle="tooltip" data-placement="right" data-original-title="删除后将无法恢复"  class="fa fa-trash btn btn-primary example5-3-2">废除</a>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</section>
		</div>
		<div th:replace="common/common_h5 :: down_foot"></div>
		<div th:replace="common/common_h5 :: down_sidebar"></div>
		<div th:replace="common/common_h5 :: error_message"></div>
		<div class="control-sidebar-bg"></div>
		<div th:replace="common/common_resource :: common_js"></div>
		<script th:src="@{/admin_js/basics/role_list.js}"></script>
</body>
</html>
